package cn.edu.zjut.mina.protocal;

/** 
 * 消息协议-响应 
 *  
 * @author Simple 
 *  
 */  
public class JMessageProtocalRes extends JAbsMessageProtocal {  
  
  private byte resultCode;// 结果码  
  
  private String content;// 响应内容  
  
  @Override  
  public int getLength() {  
    return 1 + (getContent() == null ? 0 : getContent().getBytes().length);  
  }  
  
  @Override  
  public byte getTag() {  
    return JConstant.RES;  
  }  
  
  public void setResultCode(byte resultCode) {  
    this.resultCode=resultCode;  
  }  
  
  public byte getResultCode() {  
    return resultCode;  
  }  
  
  public void setContent(String content) {  
    this.content=content;  
  }  
  
  public String getContent() {  
    return content;  
  }  
  
  @Override  
  public String toString() {  
    return "JMessageProtocalRes [content=" + content + ", resultCode=" + resultCode + ", getLength()=" + getLength()  
      + ", getTag()=" + getTag() + "]";  
  }  
}  
